﻿// <copyright file="ModelValidator.cs" company="City of Portland, BES-ASM">
// </copyright>
// <summary>ModelValidator class</summary>

namespace BESASM.EMGAATS.BusinessClasses
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using FluentValidation;

  /// <summary>
  /// A class for validating Model instances
  /// </summary>
  public class ModelValidator : AbstractValidator<Model>
  {
    /// <summary>
    /// Initializes a new instance of the <see cref="ModelValidator"/> class.
    /// </summary>
    /// <param name="ruleSet">The set of rules to apply.</param>
    public ModelValidator(RuleSet ruleSet)
    {
      // Universal rules

      // Subcomponent rules
      RuleFor(model => model.Network).SetValidator(new NetworkValidator(ruleSet));
      ////RuleForEach(model => model.Simulations).SetValidator(new SimulationValidator(ruleSet));

      // RuleSet rules
      switch (ruleSet)
      {
        case BusinessClasses.RuleSet.MasterDataCommit:
          // N/A
          break;
        case BusinessClasses.RuleSet.ModelDataCommit:
          break;
        case BusinessClasses.RuleSet.ModelDeployment:
          break;
        case BusinessClasses.RuleSet.NetworkTracing:
          // N/A
          break;
        case BusinessClasses.RuleSet.PropertyDialog:
          break;
      }
    }
  }
}
